/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86187
 * Date: 2022-07-18
 * Time: 15:29
 */

class MyMarry<T> {
    public T[] array = (T[])new Object[10];

    public T getPos(int pos) {
        return array[pos];
    }

    public void setVal(int pos,T val) {
        this.array[pos] = val;
    }
}

public class TestDemo {

    public static void main(String[] args) {
        MyMarry<Integer> myMarry = new MyMarry<>();
        myMarry.setVal(0,3);
        myMarry.setVal(1,5);
        myMarry.setVal(2,9);

        MyMarry<String> myMarry1 = new MyMarry<>();
        myMarry1.setVal(1,"abcd");
        myMarry1.setVal(4,"abcdhg");

        System.out.println(myMarry.getPos(1));
        System.out.println(myMarry1.getPos(1));

    }
}
